import 'package:flutter/material.dart';

/// 应用的常量配置
class AppConstants {
  // 颜色常量 - 现代化配色方案
  static final Color primaryColor = Color(0xFF3B82F6); // 蓝色
  static final Color secondaryColor = Color(0xFF6366F1); // 靛蓝色
  static final Color accentColor = Color(0xFFF97316); // 橙色
  static final Color backgroundColor = Color(0xFFF1F5F9); // 浅灰蓝色

  // 辅助颜色
  static final Color cardShadowColor = Color(0xFFBFDBFE); // 浅蓝色阴影
  static final Color textColor = Color(0xFF1E293B); // 深灰蓝色文本
  static final Color lightTextColor = Color(0xFF64748B); // 浅灰色文本
  static final Color successColor = Color(0xFF10B981); // 绿色
  static final Color errorColor = Color(0xFFEF4444); // 红色
  static final Color warningColor = Color(0xFFF59E0B); // 黄色

  // 渐变色预设
  static final List<Color> primaryGradient = [
    Color(0xFF3B82F6), // 蓝色
    Color(0xFF6366F1), // 靛蓝色
  ];

  static final List<Color> accentGradient = [
    Color(0xFFF97316), // 橙色
    Color(0xFFEC4899), // 粉色
  ];

  static final List<Color> coolGradient = [
    Color(0xFF3B82F6), // 蓝色
    Color(0xFF8B5CF6), // 紫色
    Color(0xFFEC4899), // 粉色
  ];

  // 尺寸常量
  static const double defaultPadding = 16.0;
  static const double smallPadding = 8.0;
  static const double largePadding = 24.0;

  static const double defaultBorderRadius = 16.0;
  static const double smallBorderRadius = 8.0;
  static const double largeBorderRadius = 24.0;
  static const double extraLargeBorderRadius = 32.0;

  static const double cardElevation = 4.0;
  static const double buttonElevation = 2.0;

  // 文本样式常量 - 现代化字体样式
  static const TextStyle headingStyle = TextStyle(
    fontSize: 32,
    fontWeight: FontWeight.bold,
    letterSpacing: 1.2,
    height: 1.2,
  );

  static const TextStyle subheadingStyle = TextStyle(
    fontSize: 18,
    fontWeight: FontWeight.w500,
    letterSpacing: 0.5,
    height: 1.4,
  );

  static TextStyle cardTitleStyle = TextStyle(
    fontSize: 24,
    fontWeight: FontWeight.bold,
    color: Colors.white,
    letterSpacing: 1.0,
    height: 1.2,
    shadows: [
      Shadow(
        color: Colors.black.withOpacity(0.5),
        offset: const Offset(1, 1),
        blurRadius: 3,
      ),
    ],
  );

  static TextStyle cardDescriptionStyle = TextStyle(
    fontSize: 16,
    color: Colors.white.withOpacity(0.9),
    height: 1.5,
    letterSpacing: 0.3,
    shadows: [
      Shadow(
        color: Colors.black.withOpacity(0.3),
        offset: const Offset(1, 1),
        blurRadius: 2,
      ),
    ],
  );

  // 按钮样式
  static final ButtonStyle elevatedButtonStyle = ElevatedButton.styleFrom(
    backgroundColor: primaryColor,
    foregroundColor: Colors.white,
    padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(defaultBorderRadius),
    ),
    elevation: buttonElevation,
    textStyle: const TextStyle(
      fontSize: 16,
      fontWeight: FontWeight.w600,
      letterSpacing: 0.5,
    ),
  );

  // 动画常量
  static const Duration defaultAnimationDuration = Duration(milliseconds: 300);
  static const Duration longAnimationDuration = Duration(milliseconds: 500);
  static const Duration quickAnimationDuration = Duration(milliseconds: 150);

  // 布局常量 - 优化横向显示
  static const double sidebarWidth = 250.0;
  static const double productCardWidth = 350.0; // 调整宽度以适应两行两列布局
  static const double productCardHeight = 235.0; // 调整高度，从240再次减少到235，以完全避免溢出

  // 横向布局常量
  static const double landscapeMinWidth = 800.0; // 最小横向宽度
  static const double landscapeMinHeight = 450.0; // 最小横向高度

  // 响应式布局断点
  static const double mobileBreakpoint = 600.0;
  static const double tabletBreakpoint = 900.0;
  static const double desktopBreakpoint = 1200.0;
}
